home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 015 / set_type.arc / SET_TYPE.ASM < prev    next >
Encoding:
Assembly Source File  |  1986-05-07  |  4.3 KB  |  101 lines

  1. ;-----------------------------------------------------------------------------
  2. ; SET_TYPE.COM V1.1
  3. ;
  4. ; SET_TYPE - Utility to modify AT hard disk parameters for drive D: so that
  5. ;            the system can handle the Compaq Deskpro (8086 or 80286) 30
  6. ;            megabyte hard disk, though it can be modified to install the
  7. ;            parameters for any hard disk. 
  8. ;
  9. ; ABSTRACT - Builds the parameter table as specified in the IBM-PC/AT
  10. ;            Tech Ref Manual, BIOS listing section, all the way in the back,
  11. ;            and then installs the table as if it were the interrupt vector
  12. ;            for interrupt 46 (41 if for drive C:)
  13. ;
  14. ; Modification History:
  15. ;
  16. ;        5/6/86 - Initial release, version 1.0
  17. ;        5/7/86 - Modified to add code to make disk parameter
  18. ;             changes permanent on controller V1.1
  19. ;
  20. ; To modify for your purposes, change the table values to fit your drive and
  21. ; change the "mov al,46h" to "mov al,41h" if you want modify the table for
  22. ; drive C:. Also, modify the line that reads "mov dl,81h" to mov dl,80h" for
  23. ; use on drive C:. This will enable you to perform a low level format with the 
  24. ; enclosed program ATDIAG.ARC, a substitute for the IBM AT Diagnostics.
  25. ;
  26. ; Note that you must first SETUP a drive type with the real diagnostics so
  27. ; that the computer will pass POST. Use the type number that is closest to
  28. ; your drive's parameters. If you can't find one that is the same, use a type
  29. ; that specifies a number of heads and cylinders (tracks) LOWER than what your
  30. ; drive has. Then run the properly modified copy of this program to modify the 
  31. ; table to modify the parameters to match. 
  32. ;
  33. ; To prepare:          MASM set_type,,,;
  34. ;            LINK set_type,,,;
  35. ;            EXE2BIN set_type.exe set_type.com
  36. ;            ERASE set_type.exe
  37. ;
  38. ; ...then put SET_TYPE on yout AUTOEXEC.BAT file so that the parameters are 
  39. ; modified everytime you boot.
  40. ;
  41. ; Once you have done the low-level format with ATDIAG, run FDISK, set the 
  42. ; partition, run FORMAT to format the disk, and VOILA.... you now have a
  43. ; true-blue "weird disk" all formatted and ready to load up.
  44. ;
  45. ; I HAVE NOT tried this to prepare a system disk, only my second drive...
  46. ; If you get it to work for that purpose, let me know...
  47. ;
  48. ;        Juan Jimenez
  49. ;        President
  50. ;        Micro Consulting Associates
  51. ;        P.O. Box 4296
  52. ;        Newport Beach, Ca. 92661-4296
  53. ;
  54. ; This program is hereby released into the Public Domain. You may use it as
  55. ; you see fit. No donations are requested. Use it, and if you find you like
  56. ; it and it helps you, let me know!!
  57. ;-----------------------------------------------------------------------------
  58. code        segment    para
  59.         assume     cs:code,ds:code
  60.         org     100h        ; Make it a .COM file
  61. set_type    proc     far
  62.         jmp    init        ; Go do your thing...
  63.  
  64. ;---------------------------------------------------------------------
  65. ; The new drive parameter table. This is for a Compaq MPI/CDC 30 meg
  66. ; unformatted drive. Modify to suit.... MAKE SURE YOUR PARAMETERS ARE
  67. ; RIGHT! In case of doubt, call the manufacturer.
  68. ;
  69. ; Be very careful that you get the # of cyls right. If it is wrong you
  70. ; MAY crash your drive if you try to access a non-existent cyl that is
  71. ; too high above the max physical cyl of your drive.
  72. ;---------------------------------------------------------------------
  73.  
  74. drive:      dw    0697d        ; Max # of cyls
  75.         db    5        ; heads
  76.         dw    0        ; Not used
  77.         dw    0128d        ; Starting Write-pre-comp cyl
  78.         db    0        ; Not used
  79.         db    0        ; Control byte - Refer to AT Tech Ref
  80.         db     0        ; Not used
  81.         db     0        ; Not used
  82.         db    0        ; Not used
  83.         dw    0696d        ; Landing zone (or park track...)
  84.         db    017d        ; Sectors per track - never changes!
  85.         db    0        ; Reserved for future use (says IBM...)
  86. theend:        db     0        ; End of table (dummy byte)
  87. init:        mov    ax,cs        ; Get the code segment of this routine...
  88.         mov    ds,ax        ; ...into DS for the INT 21 call
  89.         mov    dx,offset drive ; Set offset to the drive info table
  90.         mov    ah,25h        ; Function call 25h to set int vector 46...
  91.         mov    al,46h        ; ...for drive D: (Change to 41h for C:)
  92.         int    21h        ; Change the vector
  93.         mov    ah,09h        ; Reset the controller parameters
  94.         mov    dl,81h        ; Thru INT 13, function 9
  95.         int     13h        ; Do it...
  96.         mov    dx,offset theend ; Mark the end of the table
  97.         int    27h        ; Exit but leave the table resident
  98. set_type    endp            ; That's all, folks! (Simple, isn't it)
  99. code        ends
  100.         end    set_type
  101.